iT邦幫忙

第 11 屆 iThome 鐵人賽

DAY 28
0
自我挑戰組

30天學 LAMP 安裝系列 第 28

Day28 CentOS Stream 安裝基本 LAMP 環境 (2)

  • 分享至 

  • xImage
  •  

先補安裝 php-mysqlnd

[doraemon@centos8-gui ~]$ sudo yum install php-mysqlnd -y
上次中介資料過期檢查:0:08:35 以前,時間點為 西元2019年09月30日 (週一) 13時18分19秒。
依賴關係解析完畢。
=====================================================================================================================
 軟體包                     架構                  版本                             軟體庫                       大小
=====================================================================================================================
Installing:
 php-mysqlnd                x86_64                7.3.10-1.el8.remi                remi-modular                251 k
正在安裝相依性:
 php-pdo                    x86_64                7.3.10-1.el8.remi                remi-modular                137 k

處理事項摘要
=====================================================================================================================
安裝  2 軟體包

總下載大小:388 k
安裝的大小:1.3 M
下載軟體包:
(1/2): php-pdo-7.3.10-1.el8.remi.x86_64.rpm                                           41 kB/s | 137 kB     00:03
(2/2): php-mysqlnd-7.3.10-1.el8.remi.x86_64.rpm                                       72 kB/s | 251 kB     00:03
---------------------------------------------------------------------------------------------------------------------
總計                                                                                  75 kB/s | 388 kB     00:05
執行處理事項檢查
處理事項檢查成功。
執行處理事項測試
處理事項測試成功。
執行處理事項
  準備        :                                                                                                  1/1
  Installing  : php-pdo-7.3.10-1.el8.remi.x86_64                                                                 1/2
  Installing  : php-mysqlnd-7.3.10-1.el8.remi.x86_64                                                             2/2
  執行指令小稿: php-mysqlnd-7.3.10-1.el8.remi.x86_64                                                             2/2
  核驗        : php-mysqlnd-7.3.10-1.el8.remi.x86_64                                                             1/2
  核驗        : php-pdo-7.3.10-1.el8.remi.x86_64                                                                 2/2

已安裝:
  php-mysqlnd-7.3.10-1.el8.remi.x86_64                        php-pdo-7.3.10-1.el8.remi.x86_64

完成!

安裝並且建立 WordPress 所需的資料庫

安裝 phpMyAdmin

$ sudo yum --enablerepo=remi install phpmyadmin -y

重新啟動 Apache

$ sudo systemctl restart httpd

登入 CentOS GUI Console,開啟 Firefox 瀏覽器,網址列輸入 http://localhost/phpmyadmin,即可看到 phpMyAdmin 的登入頁面,使用者名稱先輸入 root,密碼輸入執行 mysql_secure_installation 過程中的 root 密碼。

https://ithelp.ithome.com.tw/upload/images/20190930/20119707M7jzAY7GZ3.png

登入後的首頁

https://ithelp.ithome.com.tw/upload/images/20190930/20119707ZGPh6gNmL5.png

輸入 SQL 指令,完成後按執行

https://ithelp.ithome.com.tw/upload/images/20190930/20119707pNoFLzrQhl.png

執行結果

https://ithelp.ithome.com.tw/upload/images/20190930/201197073NfQVDuplm.png

果然看到產生了一個 wordpress 資料庫,與 wordpress@localhost 資料庫使用者

https://ithelp.ithome.com.tw/upload/images/20190930/201197079thrGLfTYf.png

wordpress@localhost 資料庫使用者對於 wordpress 資料庫具有所有權限

https://ithelp.ithome.com.tw/upload/images/20190930/201197074HIdm299tb.png

安裝 mod_ssl

[doraemon@centos8-gui ~]$ yum search mod_ssl
============================================== 名稱 精確符合:mod_ssl ===============================================
mod_ssl.x86_64 : SSL/TLS module for the Apache HTTP Server
[doraemon@centos8-gui ~]$ sudo yum install mod_ssl -y
[sudo] password for doraemon:
上次中介資料過期檢查:3:17:10 以前,時間點為 西元2019年09月30日 (週一) 16時40分28秒。
依賴關係解析完畢。
=====================================================================================================================
 軟體包             架構              版本                                                軟體庫                大小
=====================================================================================================================
Installing:
 mod_ssl            x86_64            1:2.4.37-11.module_el8.0.0+172+85fc1f40             AppStream            129 k

處理事項摘要
=====================================================================================================================
安裝  1 軟體包

總下載大小:129 k
安裝的大小:268 k
下載軟體包:
mod_ssl-2.4.37-11.module_el8.0.0+172+85fc1f40.x86_64.rpm                              86 kB/s | 129 kB     00:01
---------------------------------------------------------------------------------------------------------------------
總計                                                                                  45 kB/s | 129 kB     00:02
執行處理事項檢查
處理事項檢查成功。
執行處理事項測試
處理事項測試成功。
執行處理事項
  準備        :                                                                                                  1/1
  Installing  : mod_ssl-1:2.4.37-11.module_el8.0.0+172+85fc1f40.x86_64                                           1/1
  執行指令小稿: mod_ssl-1:2.4.37-11.module_el8.0.0+172+85fc1f40.x86_64                                           1/1
  核驗        : mod_ssl-1:2.4.37-11.module_el8.0.0+172+85fc1f40.x86_64                                           1/1

已安裝:
  mod_ssl-1:2.4.37-11.module_el8.0.0+172+85fc1f40.x86_64

完成!

於本機防火牆開通 HTTPS 服務 (TCP 443 Port)

[doraemon@centos8-gui ~]$ sudo firewall-cmd --add-service=https
success
[doraemon@centos8-gui ~]$ sudo firewall-cmd --add-service=https --permanent
success
[doraemon@centos8-gui ~]$ sudo firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens160
  sources:
  services: cockpit dhcpv6-client http https ssh
  ports:
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

安裝自簽憑證工具 mkcert

為了讓網址能夠顯示 https,需要安裝憑證,但憑證的申請又需要在公網能夠使用的「主機名稱+網域名稱」,這使得在內網內不易做到。網路上有神人就寫了支小程式 mkcert,用無腦的方式產生自簽憑證,而且不論 IP 還是名稱皆可使用。

安裝 mkcert 需要事先安裝 nss-tools 與 Linux 版的 Homebrew 稱作 Linuxbrew,而安裝 Linuxbrew 需執行以下安裝指令以便安裝相關套件。

sudo yum groupinstall 'Development Tools' sudo yum install curl file git sudo yum install libxcrypt-compat

參考資料:

  1. mkcert 原作者 Github:https://github.com/FiloSottile/mkcert#installation
  2. mkcert 中文說明:https://techmoon.xyz/mkcert/
  3. Homebrew 網站:https://docs.brew.sh/Homebrew-on-Linux

接下來就開始示範安裝。


安裝 git

[doraemon@centos8-gui ~]$ sudo yum install git -y
上次中介資料過期檢查:0:32:31 以前,時間點為 西元2019年09月30日 (週一) 20時06分38秒。
依賴關係解析完畢。
=====================================================================================================================
 軟體包                          架構                  版本                           軟體庫                    大小
=====================================================================================================================
Installing:
 git                             x86_64                2.18.1-3.el8                   AppStream                186 k
正在安裝相依性:
 git-core                        x86_64                2.18.1-3.el8                   AppStream                4.1 M
 git-core-doc                    noarch                2.18.1-3.el8                   AppStream                2.3 M
 perl-Error                      noarch                1:0.17025-2.el8                AppStream                 46 k
 perl-Git                        noarch                2.18.1-3.el8                   AppStream                 77 k
 perl-TermReadKey                x86_64                2.37-7.el8                     AppStream                 40 k

處理事項摘要
=====================================================================================================================
安裝  6 軟體包

總下載大小:6.7 M
安裝的大小:36 M
下載軟體包:
(1/6): git-2.18.1-3.el8.x86_64.rpm                                                   472 kB/s | 186 kB     00:00
(2/6): perl-Error-0.17025-2.el8.noarch.rpm                                            76 kB/s |  46 kB     00:00
(3/6): git-core-doc-2.18.1-3.el8.noarch.rpm                                          1.4 MB/s | 2.3 MB     00:01
(4/6): perl-TermReadKey-2.37-7.el8.x86_64.rpm                                        114 kB/s |  40 kB     00:00
(5/6): git-core-2.18.1-3.el8.x86_64.rpm                                              1.6 MB/s | 4.1 MB     00:02
(6/6): perl-Git-2.18.1-3.el8.noarch.rpm                                               45 kB/s |  77 kB     00:01
---------------------------------------------------------------------------------------------------------------------
總計                                                                                 1.6 MB/s | 6.7 MB     00:04
執行處理事項檢查
處理事項檢查成功。
執行處理事項測試
處理事項測試成功。
執行處理事項
  準備        :                                                                                                  1/1
  Installing  : git-core-2.18.1-3.el8.x86_64                                                                     1/6
  Installing  : git-core-doc-2.18.1-3.el8.noarch                                                                 2/6
  Installing  : perl-TermReadKey-2.37-7.el8.x86_64                                                               3/6
  Installing  : perl-Error-1:0.17025-2.el8.noarch                                                                4/6
  Installing  : perl-Git-2.18.1-3.el8.noarch                                                                     5/6
  Installing  : git-2.18.1-3.el8.x86_64                                                                          6/6
  執行指令小稿: git-2.18.1-3.el8.x86_64                                                                          6/6
  核驗        : git-2.18.1-3.el8.x86_64                                                                          1/6
  核驗        : git-core-2.18.1-3.el8.x86_64                                                                     2/6
  核驗        : git-core-doc-2.18.1-3.el8.noarch                                                                 3/6
  核驗        : perl-Error-1:0.17025-2.el8.noarch                                                                4/6
  核驗        : perl-Git-2.18.1-3.el8.noarch                                                                     5/6
  核驗        : perl-TermReadKey-2.37-7.el8.x86_64                                                               6/6

已安裝:
  git-2.18.1-3.el8.x86_64                 git-core-2.18.1-3.el8.x86_64       git-core-doc-2.18.1-3.el8.noarch
  perl-Error-1:0.17025-2.el8.noarch       perl-Git-2.18.1-3.el8.noarch       perl-TermReadKey-2.37-7.el8.x86_64

完成!

執行 Linuxbrew 安裝指令

[doraemon@centos8-gui ~]$ sh -c "$(curl -fsSL <https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh>)"
==> Installing Ruby to /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 26.9M  100 26.9M    0     0  1267k      0  0:00:21  0:00:21 --:--:-- 1265k
==> Installing successful
==> /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/current/bin/ruby
ruby 2.3.7p456 (2018-03-28 revision 63024) [x86_64-linux]
==> Add Ruby to your PATH by running:
PATH=/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/current/bin:$PATH
==> This script will install:
/home/linuxbrew/.linuxbrew/bin/brew
/home/linuxbrew/.linuxbrew/share/doc/homebrew
/home/linuxbrew/.linuxbrew/share/man/man1/brew.1
/home/linuxbrew/.linuxbrew/share/zsh/site-functions/_brew
/home/linuxbrew/.linuxbrew/etc/bash_completion.d/brew
/home/doraemon/.cache/Homebrew/
/home/linuxbrew/.linuxbrew/Homebrew
==> The following new directories will be created:
/home/linuxbrew/.linuxbrew/bin
/home/linuxbrew/.linuxbrew/etc
/home/linuxbrew/.linuxbrew/include
/home/linuxbrew/.linuxbrew/lib
/home/linuxbrew/.linuxbrew/sbin
/home/linuxbrew/.linuxbrew/share
/home/linuxbrew/.linuxbrew/var
/home/linuxbrew/.linuxbrew/opt
/home/linuxbrew/.linuxbrew/share/zsh
/home/linuxbrew/.linuxbrew/share/zsh/site-functions
/home/linuxbrew/.linuxbrew/var/homebrew
/home/linuxbrew/.linuxbrew/var/homebrew/linked
/home/linuxbrew/.linuxbrew/Cellar
/home/linuxbrew/.linuxbrew/Caskroom
/home/linuxbrew/.linuxbrew/Frameworks

Press RETURN to continue or any other key to abort
/bin/mkdir
==> /usr/bin/sudo /bin/mkdir -p /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/var /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var/homebrew /home/linuxbrew/.linuxbrew/var/homebrew/linked /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/Caskroom /home/linuxbrew/.linuxbrew/Frameworks
==> /usr/bin/sudo /bin/chmod g+rwx /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/var /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var/homebrew /home/linuxbrew/.linuxbrew/var/homebrew/linked /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/Caskroom /home/linuxbrew/.linuxbrew/Frameworks
==> /usr/bin/sudo /bin/chmod 755 /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions
==> /usr/bin/sudo /bin/chown doraemon /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/var /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var/homebrew /home/linuxbrew/.linuxbrew/var/homebrew/linked /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/Caskroom /home/linuxbrew/.linuxbrew/Frameworks
==> /usr/bin/sudo /bin/chgrp doraemon /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/var /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var/homebrew /home/linuxbrew/.linuxbrew/var/homebrew/linked /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/Caskroom /home/linuxbrew/.linuxbrew/Frameworks
==> /usr/bin/sudo /bin/mkdir -p /home/doraemon/.cache/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /home/doraemon/.cache/Homebrew
==> /usr/bin/sudo /bin/chown doraemon /home/doraemon/.cache/Homebrew
==> /usr/bin/sudo /bin/chgrp doraemon /home/doraemon/.cache/Homebrew
==> Downloading and installing Homebrew...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 126384 (delta 1), reused 3 (delta 1), pack-reused 126373
Receiving objects: 100% (126384/126384), 30.05 MiB | 2.12 MiB/s, done.
Resolving deltas: 100% (92632/92632), done.
From <https://github.com/Homebrew/brew>
 * [new branch]          master     -> origin/master
 * [new tag]             0.1        -> 0.1
 * [new tag]             0.2        -> 0.2
 * [new tag]             0.3        -> 0.3
 * [new tag]             0.4        -> 0.4
 * [new tag]             0.5        -> 0.5
 * [new tag]             0.6        -> 0.6
 * [new tag]             0.7        -> 0.7
 * [new tag]             0.7.1      -> 0.7.1
 * [new tag]             0.8        -> 0.8
 * [new tag]             0.8.1      -> 0.8.1
 * [new tag]             0.9        -> 0.9
 * [new tag]             0.9.1      -> 0.9.1
 * [new tag]             0.9.2      -> 0.9.2
 * [new tag]             0.9.3      -> 0.9.3
 * [new tag]             0.9.4      -> 0.9.4
 * [new tag]             0.9.5      -> 0.9.5
 * [new tag]             0.9.8      -> 0.9.8
 * [new tag]             0.9.9      -> 0.9.9
 * [new tag]             1.0.0      -> 1.0.0
 * [new tag]             1.0.1      -> 1.0.1
 * [new tag]             1.0.2      -> 1.0.2
 * [new tag]             1.0.3      -> 1.0.3
 * [new tag]             1.0.4      -> 1.0.4
 * [new tag]             1.0.5      -> 1.0.5
 * [new tag]             1.0.6      -> 1.0.6
 * [new tag]             1.0.7      -> 1.0.7
 * [new tag]             1.0.8      -> 1.0.8
 * [new tag]             1.0.9      -> 1.0.9
 * [new tag]             1.1.0      -> 1.1.0
 * [new tag]             1.1.1      -> 1.1.1
 * [new tag]             1.1.10     -> 1.1.10
 * [new tag]             1.1.11     -> 1.1.11
 * [new tag]             1.1.12     -> 1.1.12
 * [new tag]             1.1.13     -> 1.1.13
 * [new tag]             1.1.2      -> 1.1.2
 * [new tag]             1.1.3      -> 1.1.3
 * [new tag]             1.1.4      -> 1.1.4
 * [new tag]             1.1.5      -> 1.1.5
 * [new tag]             1.1.6      -> 1.1.6
 * [new tag]             1.1.7      -> 1.1.7
 * [new tag]             1.1.8      -> 1.1.8
 * [new tag]             1.1.9      -> 1.1.9
 * [new tag]             1.2.0      -> 1.2.0
 * [new tag]             1.2.1      -> 1.2.1
 * [new tag]             1.2.2      -> 1.2.2
 * [new tag]             1.2.3      -> 1.2.3
 * [new tag]             1.2.4      -> 1.2.4
 * [new tag]             1.2.5      -> 1.2.5
 * [new tag]             1.2.6      -> 1.2.6
 * [new tag]             1.3.0      -> 1.3.0
 * [new tag]             1.3.1      -> 1.3.1
 * [new tag]             1.3.2      -> 1.3.2
 * [new tag]             1.3.3      -> 1.3.3
 * [new tag]             1.3.4      -> 1.3.4
 * [new tag]             1.3.5      -> 1.3.5
 * [new tag]             1.3.6      -> 1.3.6
 * [new tag]             1.3.7      -> 1.3.7
 * [new tag]             1.3.8      -> 1.3.8
 * [new tag]             1.3.9      -> 1.3.9
 * [new tag]             1.4.0      -> 1.4.0
 * [new tag]             1.4.1      -> 1.4.1
 * [new tag]             1.4.2      -> 1.4.2
 * [new tag]             1.4.3      -> 1.4.3
 * [new tag]             1.5.0      -> 1.5.0
 * [new tag]             1.5.1      -> 1.5.1
 * [new tag]             1.5.10     -> 1.5.10
 * [new tag]             1.5.11     -> 1.5.11
 * [new tag]             1.5.12     -> 1.5.12
 * [new tag]             1.5.13     -> 1.5.13
 * [new tag]             1.5.14     -> 1.5.14
 * [new tag]             1.5.2      -> 1.5.2
 * [new tag]             1.5.3      -> 1.5.3
 * [new tag]             1.5.4      -> 1.5.4
 * [new tag]             1.5.5      -> 1.5.5
 * [new tag]             1.5.6      -> 1.5.6
 * [new tag]             1.5.7      -> 1.5.7
 * [new tag]             1.5.8      -> 1.5.8
 * [new tag]             1.5.9      -> 1.5.9
 * [new tag]             1.6.0      -> 1.6.0
 * [new tag]             1.6.1      -> 1.6.1
 * [new tag]             1.6.10     -> 1.6.10
 * [new tag]             1.6.11     -> 1.6.11
 * [new tag]             1.6.12     -> 1.6.12
 * [new tag]             1.6.13     -> 1.6.13
 * [new tag]             1.6.14     -> 1.6.14
 * [new tag]             1.6.15     -> 1.6.15
 * [new tag]             1.6.16     -> 1.6.16
 * [new tag]             1.6.17     -> 1.6.17
 * [new tag]             1.6.2      -> 1.6.2
 * [new tag]             1.6.3      -> 1.6.3
 * [new tag]             1.6.4      -> 1.6.4
 * [new tag]             1.6.5      -> 1.6.5
 * [new tag]             1.6.6      -> 1.6.6
 * [new tag]             1.6.7      -> 1.6.7
 * [new tag]             1.6.8      -> 1.6.8
 * [new tag]             1.6.9      -> 1.6.9
 * [new tag]             1.7.0      -> 1.7.0
 * [new tag]             1.7.1      -> 1.7.1
 * [new tag]             1.7.2      -> 1.7.2
 * [new tag]             1.7.3      -> 1.7.3
 * [new tag]             1.7.4      -> 1.7.4
 * [new tag]             1.7.5      -> 1.7.5
 * [new tag]             1.7.6      -> 1.7.6
 * [new tag]             1.7.7      -> 1.7.7
 * [new tag]             1.8.0      -> 1.8.0
 * [new tag]             1.8.1      -> 1.8.1
 * [new tag]             1.8.2      -> 1.8.2
 * [new tag]             1.8.3      -> 1.8.3
 * [new tag]             1.8.4      -> 1.8.4
 * [new tag]             1.8.5      -> 1.8.5
 * [new tag]             1.8.6      -> 1.8.6
 * [new tag]             1.9.0      -> 1.9.0
 * [new tag]             1.9.1      -> 1.9.1
 * [new tag]             1.9.2      -> 1.9.2
 * [new tag]             1.9.3      -> 1.9.3
 * [new tag]             2.0.0      -> 2.0.0
 * [new tag]             2.0.1      -> 2.0.1
 * [new tag]             2.0.2      -> 2.0.2
 * [new tag]             2.0.3      -> 2.0.3
 * [new tag]             2.0.4      -> 2.0.4
 * [new tag]             2.0.5      -> 2.0.5
 * [new tag]             2.0.6      -> 2.0.6
 * [new tag]             2.1.0      -> 2.1.0
 * [new tag]             2.1.1      -> 2.1.1
 * [new tag]             2.1.10     -> 2.1.10
 * [new tag]             2.1.11     -> 2.1.11
 * [new tag]             2.1.2      -> 2.1.2
 * [new tag]             2.1.3      -> 2.1.3
 * [new tag]             2.1.4      -> 2.1.4
 * [new tag]             2.1.5      -> 2.1.5
 * [new tag]             2.1.6      -> 2.1.6
 * [new tag]             2.1.7      -> 2.1.7
 * [new tag]             2.1.8      -> 2.1.8
 * [new tag]             2.1.9      -> 2.1.9
HEAD is now at e37d1d462 Merge pull request #6505 from sjackman/bottle-deps
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  <https://github.com/Homebrew/brew#donations>
==> Tapping homebrew/core
Cloning into '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 5116, done.
remote: Counting objects: 100% (5116/5116), done.
remote: Compressing objects: 100% (4913/4913), done.
remote: Total 5116 (delta 48), reused 632 (delta 10), pack-reused 0
Receiving objects: 100% (5116/5116), 4.26 MiB | 3.27 MiB/s, done.
Resolving deltas: 100% (48/48), done.
Tapped 3 commands and 4899 formulae (5,157 files, 13.2MB).
Already up-to-date.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  <https://docs.brew.sh/Analytics>

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  <https://github.com/Homebrew/brew#donations>
==> Next steps:
- Install the Homebrew dependencies if you have sudo access:
  Debian, Ubuntu, etc.
    sudo apt-get install build-essential
  Fedora, Red Hat, CentOS, etc.
    sudo yum groupinstall 'Development Tools'
  See <https://docs.brew.sh/linux> for more information.
- Configure Homebrew in your ~/.bash_profile by running
    echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >>~/.bash_profile
- Add Homebrew to your PATH
    eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
- We recommend that you install GCC by running:
    brew install gcc
- Run `brew help` to get started
- Further documentation:
    <https://docs.brew.sh>
Warning: /home/linuxbrew/.linuxbrew/bin is not in your PATH.

安裝 nss-tools

[doraemon@centos8-gui ~]$ sudo yum install nss-tools -y
上次中介資料過期檢查:0:39:30 以前,時間點為 西元2019年09月30日 (週一) 20時06分38秒。
依賴關係解析完畢。
=====================================================================================================================
 軟體包                     架構                    版本                            軟體庫                      大小
=====================================================================================================================
Installing:
 nss-tools                  x86_64                  3.41.0-5.el8                    AppStream                  567 k

處理事項摘要
=====================================================================================================================
安裝  1 軟體包

總下載大小:567 k
安裝的大小:3.6 M
下載軟體包:
nss-tools-3.41.0-5.el8.x86_64.rpm                                                    1.2 MB/s | 567 kB     00:00
---------------------------------------------------------------------------------------------------------------------
總計                                                                                 313 kB/s | 567 kB     00:01
執行處理事項檢查
處理事項檢查成功。
執行處理事項測試
處理事項測試成功。
執行處理事項
  準備        :                                                                                                  1/1
  Installing  : nss-tools-3.41.0-5.el8.x86_64                                                                    1/1
  執行指令小稿: nss-tools-3.41.0-5.el8.x86_64                                                                    1/1
  核驗        : nss-tools-3.41.0-5.el8.x86_64                                                                    1/1

已安裝:
  nss-tools-3.41.0-5.el8.x86_64

完成!

以 Linuxbrew 安裝 mkcert

[doraemon@centos8-gui ~]$ /home/linuxbrew/.linuxbrew/bin/brew install mkcert
==> Installing dependencies for mkcert: patchelf, zlib, m4, gmp, mpfr, libmpc, isl@0.18 and gcc
==> Installing mkcert dependency: patchelf
==> Downloading <https://linuxbrew.bintray.com/bottles/patchelf-0.10.x86_64_linux.bottle.tar.gz>
==> Downloading from <https://akamai.bintray.com/98/988b224305ff3fecadf9bbf5fbe1b18061077be6c896935b2cef29298526f5b8?_>
######################################################################## 100.0%
==> Pouring patchelf-0.10.x86_64_linux.bottle.tar.gz
  /home/linuxbrew/.linuxbrew/Cellar/patchelf/0.10: 8 files, 873.9KB
==> Installing mkcert dependency: zlib
==> Downloading <https://linuxbrew.bintray.com/bottles/zlib-1.2.11.x86_64_linux.bottle.tar.gz>
######################################################################## 100.0%
==> Pouring zlib-1.2.11.x86_64_linux.bottle.tar.gz
  /home/linuxbrew/.linuxbrew/Cellar/zlib/1.2.11: 12 files, 392.3KB
==> Installing mkcert dependency: m4
==> Downloading <https://linuxbrew.bintray.com/bottles/m4-1.4.18.x86_64_linux.bottle.tar.gz>
==> Downloading from <https://akamai.bintray.com/5a/5a2327087fb76145b4d0fb23acc244115adc3ced14ffc2a6231159a4f16c8a7f?_>
######################################################################## 100.0%
==> Pouring m4-1.4.18.x86_64_linux.bottle.tar.gz
  /home/linuxbrew/.linuxbrew/Cellar/m4/1.4.18: 13 files, 1.1MB
==> Installing mkcert dependency: gmp
==> Downloading <https://linuxbrew.bintray.com/bottles/gmp-6.1.2_3.x86_64_linux.bottle.1.tar.gz>
==> Downloading from <https://akamai.bintray.com/a2/a21f68e8df094a2bccca845911eae1cf52bdefd19ca53cfd04aacf2a8112ece9?_>
######################################################################## 100.0%
==> Pouring gmp-6.1.2_3.x86_64_linux.bottle.1.tar.gz
  /home/linuxbrew/.linuxbrew/Cellar/gmp/6.1.2_3: 20 files, 3.8MB
==> Installing mkcert dependency: mpfr
==> Downloading <https://linuxbrew.bintray.com/bottles/mpfr-4.0.2.x86_64_linux.bottle.tar.gz>
==> Downloading from <https://akamai.bintray.com/cf/cffaa9976a516130ac5b979eae7bdd62180ed8924bb52bf0b30935174b1cbab0?_>
######################################################################## 100.0%
==> Pouring mpfr-4.0.2.x86_64_linux.bottle.tar.gz
  /home/linuxbrew/.linuxbrew/Cellar/mpfr/4.0.2: 29 files, 5.2MB
==> Installing mkcert dependency: libmpc
==> Downloading <https://linuxbrew.bintray.com/bottles/libmpc-1.1.0.x86_64_linux.bottle.tar.gz>
==> Downloading from <https://akamai.bintray.com/b3/b31648a86228a042aaa8e7d58faba7859059910a427f9ef4211b06bd9152f8c2?_>
######################################################################## 100.0%
==> Pouring libmpc-1.1.0.x86_64_linux.bottle.tar.gz
  /home/linuxbrew/.linuxbrew/Cellar/libmpc/1.1.0: 13 files, 1.5MB
==> Installing mkcert dependency: isl@0.18
==> Downloading <https://linuxbrew.bintray.com/bottles/isl@0.18-0.18.x86_64_linux.bottle.tar.gz>
==> Downloading from <https://akamai.bintray.com/3e/3ef95686496676a3c73c57db6eee32a9f039e9c2b7ccf173c3b1941124ef6f78?_>
######################################################################## 100.0%
==> Pouring isl@0.18-0.18.x86_64_linux.bottle.tar.gz
==> Caveats
isl@0.18 is keg-only, which means it was not symlinked into /home/linuxbrew/.linuxbrew,
because this is an alternate version of another formula.

For compilers to find isl@0.18 you may need to set:
  export LDFLAGS="-L/home/linuxbrew/.linuxbrew/opt/isl@0.18/lib"
  export CPPFLAGS="-I/home/linuxbrew/.linuxbrew/opt/isl@0.18/include"

For pkg-config to find isl@0.18 you may need to set:
  export PKG_CONFIG_PATH="/home/linuxbrew/.linuxbrew/opt/isl@0.18/lib/pkgconfig"

==> Summary
  /home/linuxbrew/.linuxbrew/Cellar/isl@0.18/0.18: 81 files, 6.4MB
==> Installing mkcert dependency: gcc
==> Downloading <https://linuxbrew.bintray.com/bottles/gcc-5.5.0_4.x86_64_linux.bottle.2.tar.gz>
==> Downloading from <https://akamai.bintray.com/40/406111bf6c70681f2acbf39bb2462da0a15e1522d01bd909abed43556dff50ca?_>
######################################################################## 100.0%
==> Pouring gcc-5.5.0_4.x86_64_linux.bottle.2.tar.gz
==> Creating the GCC specs file: /home/linuxbrew/.linuxbrew/Cellar/gcc/5.5.0_4/lib/gcc/x86_64-unknown-linux-gnu/5.5.0
  /home/linuxbrew/.linuxbrew/Cellar/gcc/5.5.0_4: 1,355 files, 169.6MB
==> Installing mkcert
==> Downloading <https://linuxbrew.bintray.com/bottles/mkcert-1.4.0.x86_64_linux.bottle.tar.gz>
==> Downloading from <https://akamai.bintray.com/a4/a40257c8cc9547ab98595a907e3f2a8d2101a7d49c4faa67b3b7ef66a68a7aec?_>
######################################################################## 100.0%
==> Pouring mkcert-1.4.0.x86_64_linux.bottle.tar.gz
  /home/linuxbrew/.linuxbrew/Cellar/mkcert/1.4.0: 7 files, 4.6MB
==> Caveats
==> isl@0.18
isl@0.18 is keg-only, which means it was not symlinked into /home/linuxbrew/.linuxbrew,
because this is an alternate version of another formula.

For compilers to find isl@0.18 you may need to set:
  export LDFLAGS="-L/home/linuxbrew/.linuxbrew/opt/isl@0.18/lib"
  export CPPFLAGS="-I/home/linuxbrew/.linuxbrew/opt/isl@0.18/include"

For pkg-config to find isl@0.18 you may need to set:
  export PKG_CONFIG_PATH="/home/linuxbrew/.linuxbrew/opt/isl@0.18/lib/pkgconfig"

接下來就以 mkcert 產生一個本地的 CA

[doraemon@centos8-gui .linuxbrew]$ /home/linuxbrew/.linuxbrew/Cellar/mkcert/1.4.0/bin/mkcert -install
Created a new local CA at "/home/doraemon/.local/share/mkcert" 
[sudo] password for doraemon:
The local CA is now installed in the system trust store! 
The local CA is now installed in the Firefox and/or Chrome/Chromium trust store (requires browser restart)! 
[doraemon@centos8-gui .linuxbrew]$ ls /home/doraemon/.local/share/mkcert
rootCA-key.pem  rootCA.pem

接下來我們就為下面幾個名稱與 IP 產生證書:

  1. 127.0.0.1
  2. ::1
  3. 192.168.250.95
  4. localhost
  5. centos8-gui
  6. *.lab.example.com
[doraemon@centos8-gui ~]$ /home/linuxbrew/.linuxbrew/Cellar/mkcert/1.4.0/bin/mkcert localhost centos8-gui "*.lab.example.com" 127.0.0.1 ::1 192.168.250.95
Using the local CA at "/home/doraemon/.local/share/mkcert" 

Created a new certificate valid for the following names 
 - "localhost"
 - "centos8-gui"
 - "*.lab.example.com"
 - "127.0.0.1"
 - "::1"
 - "192.168.250.95"

Reminder: X.509 wildcards only go one level deep, so this won't match a.b.lab.example.com

The certificate is at "./localhost+5.pem" and the key at "./localhost+5-key.pem" 
[doraemon@centos8-gui ~]$ ls
localhost+5-key.pem  localhost+5.pem  下載  公共  圖片  影片  文件  桌面  模板  音樂

上一篇
Day27 CentOS Stream 安裝基本 LAMP 環境 (1)
下一篇
Day29 CentOS Stream 安裝 WordPress 與 Laravel
系列文
30天學 LAMP 安裝33
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言